postgres=# explain analyze select * from test_csv where id % 20 = 6; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- Foreign Scan on test_csv (cost=0.00..2158874.49 rows=94056 width=52) (actual time=0.084..17555.904 rows=1000000 loops=1) Filter: ((id % 20) = 6) Rows Removed by Filter: 19000000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.122 ms Execution time: 17584.319 ms (7 rows) postgres=# SET max_parallel_degree = 1; SET postgres=# explain analyze select * from test_csv where id % 20 = 6; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=1.435..18406.866 rows=2000000 loops=1) Number of Workers: 1 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=0.117..18110.968 rows=1000000 loops=2) Filter: ((id % 20) = 6) Rows Removed by Filter: 19000000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.121 ms Execution time: 18464.476 ms (9 rows) postgres=# SET max_parallel_degree = 2; SET postgres=# explain analyze select * from test_csv where id % 20 = 6; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=0.352..18983.054 rows=2000000 loops=1) Number of Workers: 2 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=0.114..14580.335 rows=666667 loops=3) Filter: ((id % 20) = 6) Rows Removed by Filter: 12666667 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.091 ms Execution time: 19042.755 ms (9 rows) postgres=# SET max_parallel_degree = 3; SET postgres=# explain analyze select * from test_csv where id % 20 = 6; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=0.502..19257.240 rows=2000000 loops=1) Number of Workers: 3 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=0.225..12668.912 rows=500000 loops=4) Filter: ((id % 20) = 6) Rows Removed by Filter: 9500000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.132 ms Execution time: 19318.254 ms (9 rows) postgres=# SET max_parallel_degree = 4; SET postgres=# explain analyze select * from test_csv where id % 20 = 6; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=0.624..21662.065 rows=2000000 loops=1) Number of Workers: 4 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=5.084..13596.788 rows=400000 loops=5) Filter: ((id % 20) = 6) Rows Removed by Filter: 7600000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.130 ms Execution time: 21732.910 ms (9 rows) postgres=# SET max_parallel_degree = 5; SET postgres=# explain analyze select * from test_csv where id % 20 = 6; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=0.561..23396.344 rows=2000000 loops=1) Number of Workers: 5 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=1.726..14533.409 rows=333333 loops=6) Filter: ((id % 20) = 6) Rows Removed by Filter: 6333333 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.118 ms Execution time: 23486.846 ms (9 rows)